package org.jeecg.modules.mes.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Description: 自定义创建生产计划VO
 * @Author: jeecg-boot
 * @Date: 2025-01-21
 * @Version: V1.0
 */
@Data
@ApiModel(value = "MesCustomPlanCreateVO", description = "自定义创建生产计划VO")
public class MesCustomPlanCreateVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "计划名称")
    private String planName;

    @ApiModelProperty(value = "关联订单ID")
    private String orderId;

    @ApiModelProperty(value = "关联订单编号")
    private String orderNo;

    @ApiModelProperty(value = "计划生产数量")
    private Integer planQuantity;

    @ApiModelProperty(value = "计划开始日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date planStartDate;

    @ApiModelProperty(value = "计划结束日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date planEndDate;

    @ApiModelProperty(value = "计划负责人")
    private String planManager;

    @ApiModelProperty(value = "优先级(1-低,2-中,3-高)")
    private Integer priority;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "工种任务列表")
    private List<CustomPlanTaskVO> tasks;

    @ApiModelProperty(value = "关联订单明细ID")
    private String orderDetailId;

    @ApiModelProperty(value = "订单明细ID列表")
    private List<String> orderDetailIds;

    @ApiModelProperty(value = "产品信息")
    private String productInfo;

    /**
     * 自定义任务VO
     */
    @Data
    @ApiModel(value = "CustomPlanTaskVO", description = "自定义任务VO")
    public static class CustomPlanTaskVO implements Serializable {
        private static final long serialVersionUID = 1L;

        @ApiModelProperty(value = "工种ID")
        private String workTypeId;

        @ApiModelProperty(value = "工种编码")
        private String workTypeCode;

        @ApiModelProperty(value = "工种名称")
        private String workTypeName;

        @ApiModelProperty(value = "工序顺序")
        private Integer sequence;

        @ApiModelProperty(value = "任务数量")
        private Integer taskQuantity;

        @ApiModelProperty(value = "预计工时")
        private Integer estimatedHours;

        @ApiModelProperty(value = "计划开始日期")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date planStartDate;

        @ApiModelProperty(value = "计划结束日期")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        private Date planEndDate;

        @ApiModelProperty(value = "是否必需工种")
        private Integer isRequired;

        @ApiModelProperty(value = "协作类型(0-独立完成,1-协作完成,2-分段完成)")
        private Integer collaborationType;

        @ApiModelProperty(value = "最大参与人数")
        private Integer maxParticipants;

        @ApiModelProperty(value = "是否允许部分领取")
        private Boolean allowPartialClaim;

        @ApiModelProperty(value = "备注")
        private String remark;

        @ApiModelProperty(value = "单价标准ID")
        private String pieceRateStandardId;

        @ApiModelProperty(value = "单价标准")
        @TableField(exist = false)
        private String pieceRateStandard;
    }
}
